<%@page isELIgnored="false" import="java.net.*" %>
<%@taglib prefix="tiles" uri="struts-tiles" %>
<%@taglib prefix="html" uri="struts-html" %>
<%@taglib prefix="c" uri="jstl" %>
					
<%@page import="com.mastercard.assets.web.util.to.UserLogin"%><div id="bodyContent">
						<h1>Campaign Types</h1>
						
						<table width="100%">
							<tr>
								<td width="30%">
									<h2>
										Campaign types
									</h2>
								</td>
								<td width="70%" align='right'>
									<a href='CrearTipoCampana.do'>
										<img alt="Crear nuevo tipo de campa&ntilde;a" src="images/btnAdd.gif">
									</a>
								</td>
							</tr>
						</table>

						<div align='center' style='text-align: center; color: red; font-size: 12px;'>
							${UserLogin.messageError}
						</div>
<c:choose>
	<c:when test="${not empty ActiveCampaignTypes}">
						<table class="tabDatos">
							<thead>
								<tr>
									<th>Name</th>
									<th>Description</th>
									<th width='80px'>Operation</th>
								</tr>
							</thead>
<c:forEach items="${ActiveCampaignTypes}" var="campaignType">
							<tr>
								<td>${campaignType.nombre}</td>
								<td>${campaignType.descripcion}</td>
								<td>
									<table border='0' style="border: none ;">
										<tr>
											<td>
												<html:form action="BorrarTipoCampana.do" method="post">
												<html:hidden property="operation" value="2"/>
												<html:hidden property="catalogoId" value="8"/>
												<html:hidden property="campo1" value="${campaignType.nombre}"/>
												<html:hidden property="regId" value="${campaignType.cveTipoCampania}"/>
												<input type='image' onclick="if( confirm('Are you sure you want to delete the campaign type\n${campaignType.nombre}?') ){ return true ; }else{ return false ; }" src='images/btnEliminar.gif' />
												</html:form>
											</td>
											<td>&nbsp;</td>
											<td>
												<html:form action="EditarTipoCampana.do" method="post">
												<html:hidden property="regId" value="${campaignType.cveTipoCampania}"/>
												<html:hidden property="campo1" value="${campaignType.nombre}"/>
												<html:hidden property="campo2" value="${campaignType.descripcion}"/>
												<html:hidden property="operation" value="3"/>
												<html:hidden property="catalogoId" value="5"/>
												<input type='image' src='images/btnEdit.gif' />
												</html:form>
											</td>
										</tr>
									</table>
								</td>
							</tr>
</c:forEach>
						</table>
						
	</c:when>
	<c:otherwise>
						<div style='text-align: center ; width: 100%; color: gray; font-size: 12px; font-weight: bold ;'>No records</div>
	</c:otherwise>
</c:choose>


					</div>
					<div id="footContent"></div>
<% 
UserLogin user = ( UserLogin ) request.getSession( true ).getAttribute( "UserLogin" ) ;

// en caso de que no sea null
if( user != null )
	user.clearMessageError( ) ;
%>
